

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

public class ScreenShotDAO {

	private SqlMapClient sqlMap = SqlMap.getInstance();
	
	public boolean insertScreenShot(ScreenShotVO screenShot) {
		try {
			ScreenShotVO exist = (ScreenShotVO)sqlMap.queryForObject("selectScreenShot", screenShot);
			if( exist != null )
				sqlMap.update("updateScreenShot", screenShot);
			else
				sqlMap.insert("insertScreenShot", screenShot);
			return true;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return false;
	}
	
	@SuppressWarnings("unchecked")
	public List<ScreenShotVO> selectScreenShotPath() {
		try {
			List<ScreenShotVO> v = sqlMap.queryForList("selectScreenShotPath");
			return v;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
}
